<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <script>
        function Person(name, sex) {
            this.name = name;
            this.sex = sex
        }

        Person.prototype.extend = function (obj) {
            for (var k in obj) {
                this[k] = obj[k];
            }
        }


        function Student(num) {
            this.num = num;
        }

        Student.prototype = new Person('jack', '男');

        var stu = new Student('001');
        console.log(stu);

    </script>
</body>

</html>